home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / libs / dfunclib.lha / dfunc_library / includes / dfunc / dfunc.i < prev   
Text File  |  1995-10-01  |  8KB  |  275 lines

  1.     IFND    DFUNC_I
  2. DFUNC_I SET    1
  3. **    $VER: gadgets.i 2.2 (25.9.95)
  4. **    Include Release 1.1
  5. **
  6. **    Descriptions of Digital Surface Gadgets.
  7. **    For use with dfunc.library ver. 37.8 or higher.
  8. **
  9. **    NOTE: This include is still under developement and be aware of that
  10. **    it is subject to change for improving the library. The only safe
  11. **    structure to use is the gadget stucture and its flags. Do not use any
  12. **    of the other structures. They are incomplete or not functioning.
  13. **
  14. **    Copyright © 1994,1995 by Digital Surface.
  15. **    All rights reserved
  16.  
  17.     IFND    EXEC_TYPES_I
  18.     INCLUDE    "exec/types.i"
  19.     ENDC
  20.  
  21. ; This is the structure of Digital Surface Gadgets (DG_). Remember that if
  22. ; you are specifying another gadgetkind than ButtonKind which is default,
  23. ; the appropriate structure has to be used cause the values don't necessary
  24. ; fit.
  25.  
  26.  STRUCTURE ButtonGadgets,0    ;size: 42 bytes
  27.  
  28.     WORD dg_Left    ; x position of gadget
  29.     WORD dg_Top        ; y position of gadget
  30.     WORD dg_Width    ; width of gadget
  31.     WORD dg_Height    ; height of gadget
  32.     WORD dg_ID        ; your personal ID for this gadget
  33.     APTR dg_Title1    ; title in unpressed state/cycle text or visable lines
  34.     APTR dg_Title2    ; title in pressed state (optional)/ or real length
  35.     APTR dg_Image1    ; pointer to an image structure/cycle images or top position
  36.     APTR dg_Image2    ; image in pressed state (optional)
  37.     LONG dg_ColorPacket ; color packet describing colors of elements in gad.
  38.     LONG dg_Flags    ; flags for gadget (see below)
  39.     APTR dg_Font    ; pointer to a TextAttr (optional)
  40.     APTR dg_Link    ; pointer to another gadget group
  41.     LABEL dg_SIZEOF
  42.  
  43. ; For scaling gadgets these structures are needed internally for the scale
  44. ; function. Do NOT alter these structures:
  45.  
  46.  STRUCTURE GadScale,0
  47.  
  48.     LONG sca_Size
  49.     LONG sca_Window
  50.     LONG sca_GadList
  51.     WORD sca_OldX
  52.     WORD sca_OldY
  53.     LABEL sca_SIZEOF
  54.  
  55. ;This body structure is used internally by the ScaleInit()/ScaleGads()
  56.  
  57. ;## Private:
  58.  
  59.  STRUCTURE ScaleBody,0
  60.  
  61.     WORD sca_Top
  62.     WORD sca_Left
  63.     WORD sca_Width
  64.     WORD sca_Height
  65.     LONG sca_Font
  66.     LABEL scb_SIZEOF
  67.  
  68. ** NOTE: These structures are subject to change in future.
  69.  
  70. ;Here is the structure for using the SliderKind gadget:
  71.  
  72. ** NOTE: Yet not final!! DO NOT USE THIS STRUCTURE!!
  73.  
  74. ;## Private:
  75.  
  76.  STRUCTURE DSLIDER,0    ;size: 40 bytes
  77.  
  78.     WORD dgsl_Left    ; x position of gadget
  79.     WORD dgsl_Top    ; y position of gadget
  80.     WORD dgsl_Width    ; width of gadget
  81.     WORD dgsl_Height    ; height of gadget
  82.     WORD dgsl_ArrowW    ; width of arrow field
  83.     WORD dgsl_ArrowH    ; height of arrow field
  84.     APTR dgsl_List    ; pointer to pointertable of text
  85.     LONG dgsl_reserved1
  86.     LONG dgsl_reserved2
  87.     LONG dgsl_ColorPacket ;colors of slider text, borders, back etc.
  88.     LONG dgsl_Flags    ; see below for flag definitions
  89.     APTR dgsl_Font    ; pointer to a TextAttr (optional)
  90.     LONG dgsl_reserved3
  91.     LABEL dgs_SIZEOF
  92.  
  93. ; Here are the FLAG definitions of the gadgets:
  94.  
  95. DG_PRESSED    EQU    $1    ;if you want the gadget to be selected
  96. DG_INPRESSABLE    EQU    $2    ;can't press this gadget down
  97. DG_INVISABLE    EQU    $4    ;you can't see this one, but it works
  98. DG_INSCALABLE    EQU    $8    ;keep same size if a window resize
  99. DG_NOBORDER    EQU    $10    ;no border around the gadget
  100. DG_NOBACK    EQU    $20    ;make back transperant (overlay on pics etc.)
  101. DG_TEXTLEFT    EQU    $40    ;draw text in gadget from left
  102. DG_TEXTRIGHT    EQU    $80    ;draw text from right
  103. DG_TEXTSHADOW    EQU    $100    ;make shadow on text
  104. DG_HOTKEY    EQU    $200    ;respond to hotkeys (see below)
  105. DG_INSENSITIVE    EQU    $400    ;don't care about char. case if a hotkey
  106. DG_SHADOWRIGHT    EQU    $800    ;shadow on the right side of gadget
  107. DG_SHADOWBOTTOM    EQU    $1000    ;shadow below gadget
  108. DG_SHADOWCORNER    EQU    $2000    ;shadow right/below of gadget (if matrix')
  109. DG_IMAGECENTER    EQU    $4000    ;put image in center of gadget
  110. DG_IMAGERIGHT    EQU    $8000    ;draw image from right
  111. DG_GHOSTED    EQU    $10000    ;ghosted look and inpressable
  112.  
  113. DG_CYCLEKIND    EQU    $20000    ;make us a cycle gadget
  114. DG_SLIDERKIND    EQU    $40000    ;a listview kind of style gadget
  115. DG_PROCESSKIND    EQU    $80000    ;start a task or jump to a code when pressed
  116. DG_TEXTKIND    EQU    $100000    ;text input
  117. DG_NUMERICKIND    EQU    $200000    ;numeric input
  118.  
  119. DG_MASK        EQU    $400000    ;Mask map
  120. DG_PROCTASK    EQU    $800000 ;CreateProc -- SUB call (Code--RTS) is default
  121.  
  122. DG_DBLBORDERV    EQU    $1000000 ;for different resolutions you can select
  123. DG_DBLBORDERH    EQU    $2000000 ;which border shall be double. This is
  124.                  ;necessary cause we don't use DisplayInfo.
  125. DG_RESERVED2    EQU    $4000000
  126.  
  127. DG_MOVABLE    EQU    $8000000
  128. DG_PICTURE    EQU    $10000000
  129. DG_TEXTEMBOSS    EQU    $20000000 ;make emboss effect on text. Only useful
  130.                   ;with bigger fonts.
  131. DG_RESERVED3    EQU    $40000000
  132.  
  133. DG_EXTENDED    EQU    $80000000 ;enable use of dg_Link field for more flags.
  134.                   ;Unfunctional, DO NOT use this flag yet!
  135.  
  136. ;Flag macros:
  137.  
  138. DG_DBLBORDERS    EQU    DG_DBLBORDERH!DG_DBLBORDERV
  139. DG_SHADOW    EQU    DG_SHADOWRIGHT!DG_SHADOWBOTTOM
  140. DG_HOTKEYS    EQU    DG_HOTKEY!DG_INSENSITIVE
  141.  
  142. * Flags of the future:
  143. *
  144. * DG_PATTERN    - Set image in patters in the gadget box (dots, squares etc.)
  145.  
  146. ;* Slider kind: DO NOT use this structure!
  147.  
  148. DG_SLIDERLEFT    EQU    $40    ;slider on left side of screen
  149. DG_SLIDERBOTTOM    EQU    $1000    ;slider in bottom of screen
  150. DG_SLIDERTOP    EQU    $800    ;slider on top of screen
  151. DG_OUTPUTBOX    EQU    $20
  152. DG_KEYS        EQU    $200    ;if you want to use the arrow-keys
  153.  
  154. ;you can also use the DG_HOTKEY flag
  155.  
  156. ** BIT definition of FLAGS of DigitalGadgets:
  157.  
  158. DGB_PRESSED        EQU    0
  159. DGB_INPRESSABLE        EQU    1
  160. DGB_INVISABLE        EQU    2
  161. DGB_INSCALABLE        EQU    3
  162. DGB_NOBORDER        EQU    4
  163. DGB_NOBACK        EQU    5
  164. DGB_TEXTLEFT        EQU    6
  165. DGB_TEXTRIGHT        EQU    7
  166. DGB_TEXTSHADOW        EQU    8
  167. DGB_HOTKEY        EQU    9
  168. DGB_INSENSITIVE        EQU    10
  169. DGB_SHADOWRIGHT        EQU    11
  170. DGB_SHADOWBOTTOM    EQU    12
  171. DGB_SHADOWCORNER    EQU    13
  172. DGB_IMAGECENTER        EQU    14
  173. DGB_IMAGERIGHT        EQU    15
  174. DGB_GHOSTED        EQU    16
  175. DGB_CYCLEKIND        EQU    17
  176. DGB_SLIDERKIND        EQU    18
  177. DGB_PROCESSKIND        EQU    19
  178. DGB_TEXTKIND        EQU    20
  179. DGB_NUMERICKIND        EQU    21
  180. DGB_MASK        EQU    22
  181. DGB_PROCTASK        EQU    23
  182. DGB_DBLBORDERV        EQU    24
  183. DGB_DBLBORDERH        EQU    25
  184.  
  185. DGB_RESERVED2        EQU    26    ;res2
  186.  
  187. DGB_MOVABLE        EQU    27
  188. DGB_PICTURE        EQU    28
  189. DGB_TEXTEMBOSS        EQU    29
  190.  
  191. DGB_RESERVED3        EQU    30    ;res3
  192.  
  193. DGB_EXTENDED        EQU    31    ;set flag and use link field for more
  194.                     ;flags (32 bits wide).
  195.  
  196. ;Flag bit macros:
  197.  
  198. DGB_DBLBORDERS        EQU    DGB_DBLBORDERH!DGB_DBLBORDERV
  199. DGB_SHADOW        EQU    DGB_SHADOWRIGHT!DGB_SHADOWBOTTOM
  200. DGB_HOTKEYS        EQU    DGB_HOTKEY!DGB_INSENSITIVE
  201.  
  202. ;DO NOT USE THESE FLAGS:
  203.  
  204. ;## Private:
  205.  
  206. DGB_SLIDERLEFT        EQU    4
  207. DGB_SLIDERRIGHT        EQU    5
  208. DGB_SLIDERTOP        EQU    10
  209. DGB_SLIDERBOTTOM    EQU    11
  210. DGB_KEYS        EQU    16
  211.  
  212. ;PrintText() Flags
  213.  
  214. DGPT_CENTER        EQU    $1
  215. DGPT_SHADOW        EQU    $2
  216.  
  217. DGPTB_CENTER        EQU    0
  218. DGPTB_SHADOW        EQU    1
  219.  
  220. ;SetFont() Flags
  221.  
  222. DGF_CHECK        EQU    $0
  223. DGF_FORCE        EQU    $1
  224.  
  225. DGFB_CHECK        EQU    0
  226. DGFB_FORCE        EQU    1
  227.  
  228. ;ClrWindow() Flags
  229.  
  230. CLR_NORMAL        EQU    $0
  231. CLR_GHOSTED        EQU    $1
  232.  
  233. CLRB_NORMAL        EQU    0
  234. CLRB_GHOSTED        EQU    1
  235.  
  236. ; This structure is used when you are gonna dump windows to printer:
  237.  
  238.  STRUCTURE PrintWindow,0
  239.  
  240.     WORD prt_Top        ;x start position of print
  241.     WORD prt_Left        ;y start position
  242.     WORD prt_Width        ;width of window to be printed
  243.     WORD prt_Height        ;height of window to be printed
  244.     WORD prt_AspectX        ;horizontal aspect of print
  245.     WORD prt_AspectY        ;vertical aspect of print
  246.     LABEL prt_SIZEOF
  247.  
  248. ; This structure is used to define the height, width and zoom position
  249. ; of a sample:
  250.  
  251.  STRUCTURE DrawSample,0
  252.  
  253.     LONG samp_Sample        ;pointer to sample buffer (public,chip)
  254.     WORD samp_Left        ;x position of drawing area
  255.     WORD samp_Top        ;y position of drawing area
  256.     WORD samp_Width        ;width of drawing area
  257.     WORD samp_Height        ;heigth of drawing area
  258.     WORD samp_ZoomPos        ;start show sample from this position
  259.     WORD samp_ZoomSize        ;used as length of visable sample
  260.     LABEL samp_SIZEOF
  261.  
  262.  
  263. ;DFAllocList() allows you to allocate a memory pool by a list.
  264.  
  265.  STRUCTURE DF_PoolList,0
  266.  
  267.     LONG dmeml_Size
  268.     LONG dmeml_Attr
  269.     LABEL dmeml_SIZEOF
  270.  
  271. DF_IDCMP    =    $8!$10!$200000 ;MouseMove!MouseButtons!VanillaKey
  272. DF_IDCMPRAW    =    0 ;not yet available, DO NOT use this one!
  273.  
  274.     ENDC    ; DFUNC_I
  275.